//Added by Tyler on May 6th
#pragma once

#include "Globals.h"


enum eMouseButtons								// enumerate the different mouse buttons available
{
	LEFT_MOUSE_BUTTON,
	RIGHT_MOUSE_BUTTON,
	MIDDLE_MOUSE_BUTTON
};

class Input
{
private:
	Input();								// as this is a singleton, the ctor is private
	unsigned int			m_Countdown[256];
	IDirectInput8*			m_pDIObject;		// direct input device
	LPDIRECTINPUTDEVICE8	m_pDIKeyboard;		// device managing keyboard input
	LPDIRECTINPUTDEVICE8	m_pDIMouse;			// device managing mouse input
	char					m_kbBuffer[256];	// captures keyboard input
	bool					m_kbWasHit[256];	// records keyboard input
	DIMOUSESTATE			m_mouseState;		// captures mouse input


public:
	inline static Input* Engine()			// the instance of the singleton Input
	{
		static Input input;
		return &input;
	}

	bool m_bMouseButtonDown[4];

	bool	Init(HWND hWnd, HINSTANCE hInst);
	void	PollDevices();
	bool	keyDown(unsigned char key); //This is for one key strike
	bool	keyPressed(unsigned char key); //This is for input that needs to be continuous
	bool	mouseButtonDown(int button);
	float	mouseDX();
	float	mouseDY();
	float	mouseDZ();
	~Input();
};
